import stackdemo.MyStack;

import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        //Stack<Integer> stack = new Stack<Integer>();
        MyStack stack = new MyStack();
        //压栈,插入元素,先进后出
        stack.push(12);
        stack.push(23);
        stack.push(34);
        stack.push(45);
        //出栈
        int ret1 = stack.pop();//元素出栈
        System.out.println(ret1);
        int ret2 = stack.peek();//不出栈,但是会获得栈顶元素值
        System.out.println(ret2);
        //判空
        System.out.println(stack.isEmpty());
    }
}
